<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="t" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
	<jsp:include page="/WEB-INF/views/title.jsp" />
</title>
<jsp:include page="/WEB-INF/views/head.jsp" />
</head>
<body>
	<div class="well bordered-top bordered-sky">
		<div class="mb-3">
			<form action="list" role="form" class="form-inline">
				<div class="form-group">
					<label class="control-label" for="userName">用户名</label>
					<input type="text" class="form-control" id="userName" name="search_userName:CONTAINS" value="${requestScope['search_userName:CONTAINS'][0]}" placeholder="用户名" />
				</div>
				<div class="form-group">
					<div class="col-md-1"></div>
					<button type="submit" class="btn btn-info">
						<i class="fa fa-search"></i>
						查询
					</button>
				</div>
			</form>
		</div>
		<div class="mb-3">
			<a href="create?id=1" class="btn btn-success btn-sm mr-2"><i class="fa fa-plus"></i>新增</a>
			<a href="create" class="btn btn-success btn-sm mr-2"><i class="fa fa-copy"></i>复制</a>
			<a href="javascript:void(0);" class="btn btn-warning btn-sm mr-2"><i class="fa fa-edit"></i>修改</a>
			<a href="javascript:void(0);" class="btn btn-danger btn-sm mr-2"><i class="fa fa-trash-o"></i>删除</a>
		</div>
		<div class="flip-scroll table-scrollable">
			<table class="table table-bordered table-hover flip-content" id="listTable">
				<thead class="flip-content bordered-palegreen">
					<tr>
						<th col="id">ID</th>
						<th col="userName">用户名</th>
						<th col="locked">锁定状态</th>
						<th>激活状态</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach var="user" varStatus="status" items="${pageData.content}">
						<tr>
							<td>${user.id}</td>
							<td>${user.userName}</td>
							<td>
								<c:choose>
									<c:when test="${user.locked}">
										<label style="position: relative;height: 18px;margin: 0;">
											<input class="checkbox-slider slider-icon colored-palegreen" checked="checked" disabled="disabled" type="checkbox">
											<span class="text" style="margin-top:-2px;"></span>
										</label>
										<span class="label label-azure">已锁定</span>
									</c:when>
									<c:otherwise>
										<label style="position: relative;height: 18px;margin: 0;">
											<input class="checkbox-slider slider-icon colored-palegreen" disabled="disabled" type="checkbox">
											<span class="text" style="margin-top:-2px;"></span>
										</label>
										<span class="label label-azure">未锁定</span>
									</c:otherwise>
								</c:choose>
							</td>
							<td>
								<c:choose>
									<c:when test="${user.active}">
										<label style="position: relative;height: 18px;margin: 0;">
											<input class="checkbox-slider slider-icon colored-palegreen" checked="checked" disabled="disabled" type="checkbox">
											<span class="text" style="margin-top:-2px;"></span>
										</label>
										<span class="label label-azure">已激活</span>
									</c:when>
									<c:otherwise>
										<label style="position: relative;height: 18px;margin: 0;">
											<input class="checkbox-slider slider-icon colored-palegreen" disabled="disabled" type="checkbox">
											<span class="text" style="margin-top:-2px;"></span>
										</label>
										<span class="label label-azure">未激活</span>
									</c:otherwise>
								</c:choose>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<t:page pageData="${pageData}" action="list" sortTable="#listTable" search="true"/>
		<div class="widget"></div>
	</div>
	<jsp:include page="/WEB-INF/views/script.jsp" />
</body>
</html>
